package com.cyzy.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cyzy.dao.ClassTeacherDao;
import com.cyzy.dao.StudentCourseDao;
import com.cyzy.dao.TeacherEvaluationDao;
import com.cyzy.dto.Result;
import com.cyzy.pojo.Teacher;
import com.cyzy.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/teacher")
public class TeacherController {

    @Autowired
    private TeacherService teacherService;

//    分页查询
    @GetMapping("/selectTeacher")
    public Result selectTeacher(TeacherEvaluationDao teacherEvaluationDao){
        Page<TeacherEvaluationDao> teacherPage = teacherService.selectTeacher(teacherEvaluationDao);
        return Result.ok().data("teacherPage",teacherPage);
    }

//    查询所有老师 //我用了不许改哈 zzh
    @GetMapping("/getTeacher")
    public Result getTeacher(Teacher teacher){
        List<Teacher> teacherList = teacherService.getTeacher(teacher);
        return Result.ok().data("teacherList",teacherList);
    }

    @GetMapping("/showTeacher")
    public Result showTeacher(ClassTeacherDao classTeacherDao){
        List<ClassTeacherDao> showTeacher = teacherService.showTeacher(classTeacherDao);
        return Result.ok().data("showTeacher", showTeacher);
    }




}
